package org.example.bootquartz.controller;

import org.example.bootquartz.common.R;
import org.example.bootquartz.service.QuartzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 季舟
 * @Date 2025-02-07 15:55
 */
@RestController
@RequestMapping("/quartz")
public class QuartzController {
    @Autowired
    private QuartzService quartzService;

    @GetMapping("createJob")
    public R createJob() {
        return quartzService.addCronjob("job1", "jobGroup1", "org.example.bootquartz.taskjob.TaskJob", "0/5 * * * * ?", "trigger1", "triggerGroup1");
    }
}
